package com.initialize.core.filter.head;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created with IntelliJ IDEA.
 * User: jane
 * Date: 2019/12/29
 * Time: 10:10 下午
 * Description:
 */
@Slf4j
@Component
public class BaseWebMvcConfigurer implements WebMvcConfigurer {


    final
    InternalWebRequestInterceptor internalWebRequestInterceptor;

    public BaseWebMvcConfigurer(InternalWebRequestInterceptor internalWebRequestInterceptor) {
        this.internalWebRequestInterceptor = internalWebRequestInterceptor;
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry
                .addWebRequestInterceptor(this.internalWebRequestInterceptor)
                .addPathPatterns("/**");
    }

}